// 路由规则 和 实例化路由对象
import Vue from 'vue';
import VueRouter from 'vue-router';

import Home from '@/components/Home.vue';
import Ranking from '@/components/Ranking.vue'
import Search from '@/components/Search.vue'
import Details from '@/components/Details.vue'
Vue.use(VueRouter);

export default new VueRouter({
	routes: [
		{
			path:'/home',
			component:Home
		},
		{//排行榜
			path:'/pai',
			component:Ranking
		},
		{//搜索页面
			path:'/shou',
			component:Search
		},
		{//详情页
			path:'/xiang',
			name: 'detail',
			component:Details
		},
		{
			path:'*',
			redirect: '/home'
		}
	]
})